var e, t = require("@vant/area-data"), i = (e = require("@vant/weapp/toast/toast")) && e.__esModule ? e : {
    default: e
};

var a = require("../../utils/request"), o = require("../../utils/api"), r = require("../../utils/encrypt");

Page({
    data: {
        themeColor: getApp().globalData.themeColor,
        memberList: [],
        areaList: t.areaList
    },
    onShow: function() {
        this.selectFamilyListByJwt();
    },
    onPullDownRefresh: function() {
        this.selectFamilyListByJwt();
    },
    selectFamilyListByJwt: function() {
        var e = this;
        wx.showLoading({
            title: "正在加载中...",
            mask: !0
        }), a.request(a.HttpMethod.GET, o.apiRoute.selectFamilyListByJwt, {}).then(function(t) {
            if ("20000" == t.code) {
                var a = t.data;
                a.forEach(function(t) {
                    t.mobileShow = r.encryptMobile(t.mobile), t.certificateNoShow = r.encryptIdCard(t.certificateNo), 
                    t.nameShow = r.encryptName(t.name);
                    var i = "";
                    "" != t.provinceCode && null != t.provinceCode && (i += e.data.areaList.province_list[t.provinceCode] + " "), 
                    "" != t.cityCode && null != t.cityCode && (i += e.data.areaList.city_list[t.cityCode] + " "), 
                    "" != t.districtCode && null != t.districtCode && (i += e.data.areaList.county_list[t.districtCode]), 
                    t.addressShow = i + " " + t.address;
                }), e.setData({
                    memberList: a
                }), wx.hideLoading();
            } else (0, i.default)({
                message: t.message,
                duration: 5e3
            }), wx.hideLoading();
        });
    },
    addFamily: function() {
        wx.navigateTo({
            url: "/pages/my-link-family-edit/my-link-family-edit"
        });
    }
});